import dispatcher from './dispatcher'
import constants from './constants'

export default {
    notify: (message, delay, duration) => {
        dispatcher.dispatch({
            actionType: constants.NOTIFY,
            message: message,
            delay: delay,
            duration: duration
        })
    },
    alert: (message, okLabel, title, ok) => {
        dispatcher.dispatch({
            actionType: constants.ALERT,
            message: message,
            title: title,
            ok: ok,
            okLabel: okLabel
        })
    },
    confirm: (options) => {
        dispatcher.dispatch({
            actionType: constants.CONFIRM,
            message: options.message,
            title: options.title,
            ok: options.ok,
            okLabel: options.okLabel,
            cancel: options.cancel,
            cancelLabel: options.cancelLabel
        })
    }
}
